emojichooser: Allow the section buttons to wrap
authorMatthias Clasen <mclasen@redhat.com>
Tue, 22 Dec 2020 03:45:48 +0000 (22:45 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 26 Jan 2021 04:32:15 +0000 (23:32 -0500)
Use a flowbox instead of a horizontal box for
the section buttons at the bottom, so they can
wrap and allow for narrow layout.

We also need to stop giving the scrolledwindow
a content height, so it can shrink to make room
for more rows of section buttons.

gtk/ui/gtkemojichooser.ui

index 823fd026d58343c9b093f4e6ccde036a474cf551..9fd383f8fe084d77c5691324685b64b4e605c2b3 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface domain="gtk40">
   <template class="GtkEmojiChooser" parent="GtkPopover">
+    <property name="height-request">410</property>
     <style>
       <class name="emoji-picker"/>
     </style>
@@ -33,7 +34,6 @@
                       <object class="GtkScrolledWindow" id="scrolled_window">
                         <property name="vexpand">1</property>
                         <property name="hscrollbar-policy">never</property>
-                        <property name="min-content-height">250</property>
                         <style>
                           <class name="view"/>
                         </style>
                       </object>
                     </child>
                     <child>
-                      <object class="GtkBox">
+                      <object class="GtkFlowBox">
+                        <property name="min-children-per-line">3</property>
+                        <property name="max-children-per-line">10</property>
                         <style>
                           <class name="emoji-toolbar"/>
                         </style>